/*
 * @Author: your name
 * @Date: 2021-02-19 13:58:10
 * @LastEditTime: 2022-05-26 14:37:26
 * @LastEditors: huangbc
 * @Description: In User Settings Edit
 * @FilePath: /shb-fe-pc/server/model/httpConfigModel.js
 */
const { isNotLocalEnv } = require('./proxyConfigModel');
const http = require('http')
const https = require(isNotLocalEnv ? 'https' : 'http');
// 默认配置
const DEFAULT_OPIONS = {
  // host: '127.0.0.1',
  // port: 8080,
  // headers:{
  //   'cookie': ''
  // }
  host: '192.168.1.170',
  port: 8080,
  headers:{
    'cookie':'__wpkreporterwid_=dcedba81-fe52-4dee-be64-3227d91b9a31; JSESSIONID=34BF19F27207AAC8169462EF3209853D; SESSION=1bdad87a-e733-4c0f-b27c-b8a06c0ee5e3'
  }
};
// https agent
const HTTPSAGENT = new https.Agent({
  keepAlive: true,
  maxSockets: 1024,
  maxFreeSockets: 256,
});

const HTTPAGENT = new http.Agent({
  keepAlive: true,
  maxSockets: 1024,
  maxFreeSockets: 256,
});

module.exports = {
  DEFAULT_OPIONS,
  HTTPSAGENT,
  HTTPAGENT
};
